package com.xjgz.aio.socket;

import com.xjgz.aio.socket.transport.AioSession;

import java.nio.channels.AsynchronousSocketChannel;

public interface NetMonitor {

    /**
     * 监控已接收到的连接
     * 
     * @return null：拒绝该连接；非null：接受该连接
     */
    AsynchronousSocketChannel shouldAccept(AsynchronousSocketChannel channel);

    void afterRead(AioSession session, int readSize);

    void beforeRead(AioSession session);

    void afterWrite(AioSession session, int writeSize);

    void beforeWrite(AioSession session);
}
